package com.haiyuancloud.base.ctr;

import com.alibaba.fastjson.JSON;
import com.haiyuancloud.base.deal.ctr.BaseCtr;
import com.haiyuancloud.base.id.service.BaseBaiduIdService;
import com.haiyuancloud.base.id.service.BaseIdService;
import lombok.extern.log4j.Log4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.*;


@Log4j
@RestController
@RequestMapping("/id/ctr")
public class IdCtr extends BaseCtr {

    @Resource
    private BaseBaiduIdService baseBaiduIdService;

    /***
     * 加载主键索引
     * @param submitMap 提交参数
     */
    @RequestMapping(value = "/getId")
    @ResponseBody
    public Map<String, Object> getId(@RequestBody Map<String, Object> submitMap) {
        Map<String,Object> id = this.getDefaultResultData();
        id.put("id",baseBaiduIdService.getLongId());
        return id;
    }
}
